function* gn(){
    yield async01();
    yield async02();
    return "end.";
}

var g = gn();

console.log(g.next());
console.log(g.next());
console.log(g.next());

function async01(){
    setTimeout(function(){
        console.log("1111111");
    }, 1000);

    return "01";
}

function async02(){
    setTimeout(function(){
        console.log("222");
    }, 2000);

    return "02";
}